import Qt 4.7
import QtQuick 1.1
import com.nokia.meego 1.0

Page {
    tools: commonTools

    Rectangle {
        id: title
        color: "steelblue"
        width: parent.width
        height: 50
        anchors {
            horizontalCenter: parent.horizontalCenter
            top: parent.top
        }

        Text {
            id: headerView
            anchors.fill: parent
            height: 50
            text: titleFromQt
            font {
                family: "Arial"
                pixelSize: 27
                wordSpacing: 2
                bold: true
            }
            verticalAlignment: Text.AlignVCenter
            horizontalAlignment: Text.AlignHCenter
        }
    }

    Text {
        id: label
        text: textFromQt
        font {
            family: "Arial"
            pixelSize: 27
            wordSpacing: 2
        }
        smooth: true
        anchors {
            horizontalCenter: parent.horizontalCenter
            top: title.bottom
            topMargin: 10
        }
        verticalAlignment: Text.AlignVCenter
        horizontalAlignment: Text.AlignJustify
        wrapMode: Text.WordWrap
        textFormat: Text.RichText
        visible: true
        width: parent.width
    }

    Component {
        id: listDelegate
        Item {
            height: textMsg.height
            width: parent.width

            Text {
                id: textMsg
                text: modelData
                font {
                    family: "Arial"
                    pixelSize: 27
                    wordSpacing: 2
                }
                smooth: true
                verticalAlignment: Text.AlignVCenter
                horizontalAlignment: Text.AlignJustify
                wrapMode: Text.WordWrap
                textFormat: Text.RichText
                visible: true
                width: parent.width
            }

            MouseArea {
                anchors.fill: parent
                onClicked: returnString(textMsg.text)
            }
        }
    }

    ListView {
        id: list
        anchors {
            top: label.bottom
            topMargin: 10
            right: parent.right
            left: parent.left
            bottom: parent.bottom
        }
        highlight: Rectangle { color: "lightsteelblue"; radius: 5 }
        focus: false

        model: myModel
        delegate: listDelegate
    }
}
